<template>
  <view class="model_box">
    <view v-for="(item,index) in itemModel":key="index" class="model" :class="index===itemModel.length-1?'border-none':''">
      <view class="label">{{ item.label }}</view>
      <u-input :type="item.input" class="value" :placeholder="item.placeholder" :disabled="item.disabled" border="none" disabledColor="white" inputAlign="right" v-model="item.value" @change="change(item,index)"></u-input>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    itemModel: {
      type: Array,
      default: () => [],
    },
  },
  methods:{
    change(item,index){
      console.log('change', item);
      this.$emit('send', {data:item,index:index});
    }
  }
}
</script>

<style scoped lang="scss">
.model_box {
  background-color: white;
  border-radius: 10rpx;
  padding: 20rpx;
  margin: 20rpx 0;
  .model {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1rpx solid #f1f1f1;
    height: 80rpx;

    .label {
      font-size: 28rpx;
    }
    .value {
      font-size: 28rpx;
      
    }
  }
  .border-none{
    border: none !important;
  }
}
</style>
